K-Nearest Neighbor
How it works
- Choose the number K of neighbours
- Take the K nearest neighbour of the new data point, according to the Euclidean distance
- Among these K neighbours, count the number of data points in each category
- Assign the new data points to the category where you counted the most neighbours
- Repeat until your model is ready
Hyperparameters
- the number of neighbours K
If k is selected to be too large, underfitting occurs: the model becomes too generalized and fails to accurately predict the data points in both train and test sets.